import request from '@/config/axios'

export interface GoodsPicVO {
  id: number
  goodId: number
  pic: string
  status: byte
  sort: number
}

// 查询产品图片管理列表
export const getGoodsPicPage = async (params) => {
  return await request.get({ url: `/cms/goods-pic/page`, params })
}

// 查询产品图片管理详情
export const getGoodsPic = async (id: number) => {
  return await request.get({ url: `/cms/goods-pic/get?id=` + id })
}

// 新增产品图片管理
export const createGoodsPic = async (data: GoodsPicVO) => {
  return await request.post({ url: `/cms/goods-pic/create`, data })
}

// 修改产品图片管理
export const updateGoodsPic = async (data: GoodsPicVO) => {
  return await request.put({ url: `/cms/goods-pic/update`, data })
}

// 删除产品图片管理
export const deleteGoodsPic = async (id: number) => {
  return await request.delete({ url: `/cms/goods-pic/delete?id=` + id })
}

// 导出产品图片管理 Excel
export const exportGoodsPic = async (params) => {
  return await request.download({ url: `/cms/goods-pic/export-excel`, params })
}
